<div class="tableform">
      <table cellspacing="0" cellpadding="0" border="0" class="gridlist">
        <tr>
              <th>物料</th>
              <th>物料名称</th>
              <th>购买量</th>
              <th>价格</th>
              <th>金额</th>
        </tr>
    <{assign var="key" value="0"}>
      <{foreach from=$res item=his}>
      <{assign var="key" value=$key+1 }>
      <tbody>
        <tr>
          <td><{$his.bn}></td>
          <td><{$his.name}></td>
          <td><{$his.nums}></td>
          <td><{$his.price}></td>
          <td><{$his.amount}></td>
          </tr>
        </tbody>
      <{/foreach}>
        <tr>
          <td>总数：</td>
          <td colspan="6"><{$key}></td>
        </tr>
      </table>
</div>